/*
 * XML Type:  InvestmentMailSyncResponse
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.InvestmentMailSyncResponse
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML InvestmentMailSyncResponse(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class InvestmentMailSyncResponseImpl extends net.ofx.types.x2003.x04.impl.AbstractSyncResponseImpl implements net.ofx.types.x2003.x04.InvestmentMailSyncResponse
{
    
    public InvestmentMailSyncResponseImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName INVACCTFROM$0 = 
        new javax.xml.namespace.QName("", "INVACCTFROM");
    private static final javax.xml.namespace.QName INVMAILTRNRS$2 = 
        new javax.xml.namespace.QName("", "INVMAILTRNRS");
    
    
    /**
     * Gets the "INVACCTFROM" element
     */
    public net.ofx.types.x2003.x04.InvestmentAccount getINVACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentAccount target = null;
            target = (net.ofx.types.x2003.x04.InvestmentAccount)get_store().find_element_user(INVACCTFROM$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "INVACCTFROM" element
     */
    public void setINVACCTFROM(net.ofx.types.x2003.x04.InvestmentAccount invacctfrom)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentAccount target = null;
            target = (net.ofx.types.x2003.x04.InvestmentAccount)get_store().find_element_user(INVACCTFROM$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.InvestmentAccount)get_store().add_element_user(INVACCTFROM$0);
            }
            target.set(invacctfrom);
        }
    }
    
    /**
     * Appends and returns a new empty "INVACCTFROM" element
     */
    public net.ofx.types.x2003.x04.InvestmentAccount addNewINVACCTFROM()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentAccount target = null;
            target = (net.ofx.types.x2003.x04.InvestmentAccount)get_store().add_element_user(INVACCTFROM$0);
            return target;
        }
    }
    
    /**
     * Gets array of all "INVMAILTRNRS" elements
     */
    public net.ofx.types.x2003.x04.InvestmentMailTransactionResponse[] getINVMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(INVMAILTRNRS$2, targetList);
            net.ofx.types.x2003.x04.InvestmentMailTransactionResponse[] result = new net.ofx.types.x2003.x04.InvestmentMailTransactionResponse[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "INVMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.InvestmentMailTransactionResponse getINVMAILTRNRSArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.InvestmentMailTransactionResponse)get_store().find_element_user(INVMAILTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "INVMAILTRNRS" element
     */
    public int sizeOfINVMAILTRNRSArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(INVMAILTRNRS$2);
        }
    }
    
    /**
     * Sets array of all "INVMAILTRNRS" element
     */
    public void setINVMAILTRNRSArray(net.ofx.types.x2003.x04.InvestmentMailTransactionResponse[] invmailtrnrsArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(invmailtrnrsArray, INVMAILTRNRS$2);
        }
    }
    
    /**
     * Sets ith "INVMAILTRNRS" element
     */
    public void setINVMAILTRNRSArray(int i, net.ofx.types.x2003.x04.InvestmentMailTransactionResponse invmailtrnrs)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.InvestmentMailTransactionResponse)get_store().find_element_user(INVMAILTRNRS$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(invmailtrnrs);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "INVMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.InvestmentMailTransactionResponse insertNewINVMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.InvestmentMailTransactionResponse)get_store().insert_element_user(INVMAILTRNRS$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "INVMAILTRNRS" element
     */
    public net.ofx.types.x2003.x04.InvestmentMailTransactionResponse addNewINVMAILTRNRS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.InvestmentMailTransactionResponse target = null;
            target = (net.ofx.types.x2003.x04.InvestmentMailTransactionResponse)get_store().add_element_user(INVMAILTRNRS$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "INVMAILTRNRS" element
     */
    public void removeINVMAILTRNRS(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(INVMAILTRNRS$2, i);
        }
    }
}
